package com.slf.flow.core.utils;

import com.slf.flow.core.io.HttpRequest;
import com.slf.flow.core.io.HttpResponse;

import java.io.IOException;

public class ConnectionHttpUtils {
    public static void iAmMyDaddy(){
        HttpRequest request = HttpRequest.create();
        String url = "https://www.cnblogs.com/ylz8401/p/6795933.html";
        request.url(url);
//        Connection connect = Jsoup.connect(url);
//        Connection connect = HttpConnection.connect(url);
//        connect.timeout(3000);
//        connect.header("Accept-Encoding", "gzip,deflate,sdch");
//        connect.header("Connection", "close");
//        connect.validateTLSCertificates(false);
        try {
            HttpResponse response = request.execute();
            System.out.println(response.getStatusCode());
//            connect.execute();
//            Connection.Response execute = connect.execute();
//            System.out.println(execute.statusMessage());
            //Document parse = connect.post();
//            System.out.println(connect.get().html());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        iAmMyDaddy();
    }
}
